package com.krisyu.visitorPattern.vpExpand1_MultiVisitor;

/**
 * @Author: Kris
 * @Date: 2022/1/9 - 01 - 09 - 21:27
 * @Description: com.krisyu.visitorPattern.vpExpand1_MultiVisitor
 * @version: 1.0
 */
public class SalaryVisitor implements ISalaryVisitor{
    @Override
    public Double totalSalary() {
        return 88.8888;
    }

    @Override
    public void visit(ConcreteElement1 element1) {
        System.out.println("\n------------------开始访问具体元素1咯-----------");
        System.out.println("Salary is = " + this.totalSalary());
        element1.doSomething();
        System.out.println("------------------访问具体元素1结束咯-----------");
    }

    @Override
    public void visit(ConcreteElement2 element2) {
        System.out.println("\n------------------开始访问具体元素2咯-----------");
        System.out.println("Salary is = " + this.totalSalary());
        element2.doSomething();
        System.out.println("------------------访问具体元素2结束咯-----------");
    }
}
